package com.ruoyi.system.domain.vo;

import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.ruoyi.common.annotation.ExcelDictFormat;
import com.ruoyi.common.convert.ExcelDictConvert;
import com.ruoyi.system.domain.PmsPurchaseRequisitionsDetail;
import lombok.Data;
import java.util.Date;
import java.util.List;


/**
 * 采购订单主，记录采购订单核心信息视图对象 pms_purchase_orders
 *
 * @author ruoyi
 * @date 2025-07-29
 */
@Data
@ExcelIgnoreUnannotated
public class PmsPurchaseOrdersVo {

    private static final long serialVersionUID = 1L;

    /**
     * 采购订单主键ID
     */
    @ExcelProperty(value = "采购订单主键ID")
    private Long poId;

    /**
     * 采购订单编号
     */
    @ExcelProperty(value = "采购订单编号")
    private String poCode;

    /**
     * 采购申请单ID
     */
    @ExcelProperty(value = "采购申请单ID")
    private Long prId;

    /**
     * 采购申请单编号
     */
    @ExcelProperty(value = "采购申请单编号")
    private String prCode;

    /**
     * 供应商ID，关联wms_suppliers表
     */
    @ExcelProperty(value = "供应商ID，关联wms_suppliers表")
    private Long supplierId;

    /**
     * 供应商编码，冗余存储便于查询
     */
    @ExcelProperty(value = "供应商编码，冗余存储便于查询")
    private String supplierCode;

    /**
     * 订单创建日期（业务日期）
     */
    @ExcelProperty(value = "订单创建日期", converter = ExcelDictConvert.class)
    @ExcelDictFormat(readConverterExp = "业=务日期")
    private Date orderDate;

    /**
     * 预计交货日期
     */
    @ExcelProperty(value = "预计交货日期")
    private Date expectedDeliveryDate;

    /**
     * 付款条款，如：T/T 30天
     */
    @ExcelProperty(value = "付款条款，如：T/T 30天")
    private String paymentTerms;

    /**
     * 订单不含税总金额
     */
    @ExcelProperty(value = "订单不含税总金额")
    private BigDecimal totalAmount;

    /**
     * 订单总税额
     */
    @ExcelProperty(value = "订单总税额")
    private BigDecimal totalTax;

    /**
     * 订单含税总金额（total_amount + total_tax）
     */
    @ExcelProperty(value = "订单含税总金额", converter = ExcelDictConvert.class)
    @ExcelDictFormat(readConverterExp = "t=otal_amount,+=,t=otal_tax")
    private BigDecimal totalAmountWithTax;

    /**
     * 订单状态: 1-草稿, 2-审批中, 3-已批准, 4-已拒绝, 5-部分收货, 6-已完成, 7-已取消
     */
    @ExcelProperty(value = "订单状态: 1-草稿, 2-审批中, 3-已批准, 4-已拒绝, 5-部分收货, 6-已完成, 7-已取消")
    private String status;

    /**
     * 审批人ID
     */
    @ExcelProperty(value = "审批人ID")
    private String approverId;

    /**
     * 审批通过时间
     */
    @ExcelProperty(value = "审批通过时间")
    private Date approvedAt;

    /**
     * 创建人ID
     */
    @ExcelProperty(value = "创建人ID")
    private Long createdBy;

    /**
     * 创建时间
     */
    @ExcelProperty(value = "创建时间")
    private Date createTime;

    /**
     * 最后更新时间
     */
    @ExcelProperty(value = "最后更新时间")
    private Date updatedAt;

    /**
     * 采购人id
     */
    private Long purchaseId;

    private String createNickName;

    private String purchaseNickName;

    private List<PmsPurchaseRequisitionsDetail> pmsPurchaseRequisitionsDetails;

    /**
     * 收货时间
     */
    private Date receivingTime;
}
